home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / MIDSTR.CC < prev    next >
Text File  |  1993-04-04  |  481b  |  18 lines

  1. mid_str(int begin, int leng, char *o_str, char *n_str)
  2. /* Extract the characters from *o_str starting at position begin for leng
  3.    number of characters and place them into *n_str.
  4. */
  5. {
  6.         if(begin > strlen(o_str)) return(1);
  7.         o_str = o_str + begin -1;
  8.         
  9.         while(*o_str && leng) {
  10.                 *n_str=*o_str;
  11.                 n_str++;
  12.                 o_str++;
  13.                 leng--;
  14.         }
  15.         *n_str=0x00;
  16.         return(0);
  17. }
  18.